package gson.gson.Interface;

import com.google.gson.InstanceCreator;
import model.User;

import java.lang.reflect.Type;
/*
Deserialized User: User{userName='Alice', age=30, password='123'}
 */
public class CustomInstanceCreator implements InstanceCreator {
    // 实现 createInstance 方法，返回一个 User 的实例
    @Override
    public User createInstance(Type type) {
        return new User("Default User", 0, "default_password");
    }
}
